package com.nidu.demo.oauth2.mapper.dataobject;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import com.nidu.demo.base.BaseTenantDO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_oauth2_client", autoResultMap = true)
public class OAuth2ClientDO extends BaseTenantDO {

    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 客户端编号
     */
    private String clientCode;

    /**
     * 客户端密钥
     */
    private String clientSecret;

    /**
     * 授权范围
     */
    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private List<String> scopes;

    /**
     * 重定向 URI
     */
    private String redirectUri;

    /**
     * 访问令牌有效时间
     */
    private Long accessTokenValiditySeconds;

    /**
     * 刷新令牌有效时间
     */
    private Long refreshTokenValiditySeconds;

    /**
     * 状态(0:禁用,1:启用)
     */
    private Integer status;

    /**
     * 是否删除
     */
    private Boolean deleted;

}
